Learn R Programming

rmngb (version 0.6-1)

LISP functions: LISP-like Functions

Description

For the LISPstalgics.

Usage

cons(a, b) car(x) cdr(x) cadr(x)

Arguments

a
first object to cons.
b
second object to cons.
x
consed object.

Value

cons returns a functions that takes another function as an argument. car, cdr and cadr return the objects initially consed.

References

SICP.

See Also

list.

Examples

Run this code
a <- cons(rnorm(10), data.frame(a = 1:5, b = 6:10))
car(a)
cdr(a)

Run the code above in your browser using DataLab